Advances in computer technology have produced more compact, less expensive and faster computer devices than ever before. Where computers once occupied entire rooms, they are now compact enough to be portable and fit in one's hand. Examples of such devices are cellular telephones, handheld computers, personal digital assistants (PDA's), and the like.
Display size, resolution and color capability are other aspects that are affected by the compact size of these devices. The display of these devices typically have a correspondingly small elongated rectangular display screen operatively mounted on a surface of the device. While holding the device in its operation and viewing orientation, a user may operate the device using externally mounted buttons on the device housing or touch screen controls on the display. With the device in such operation and viewing orientation the display screen is typically in a vertically elongated orientation (i.e., a “portrait” orientation) as seen by the user.
If the user physically rotates the device ninety degrees, the system must rotate the screen contents ninety degrees in the opposite direction for a correctly oriented image to be displayed to the user. To do this, the typical system maintains an intermediate screen buffer of pixels that must be rotated ninety degrees prior to insertion in the display buffer, thereby providing a portrait mode emulation using a landscape orientation. One disadvantage with this approach is that direct screen writes to the display buffer are not possible, because the physical orientation of the screen does not match the orientation of the display buffer. This results in increased demands on the CPU and memory in a device with limited resources.
Other systems have used various mechanisms to rotate image data in the screen buffer. In one such system, the pixels are rotated one by one and the bits representing the color or gray scale level for an individual pixel in the screen buffer are extracted from the original memory location in the screen buffer and placed into a temporary byte. A memory location in the display buffer in which to place the pixel is then determined. The new location will reflect the ninety degree rotation. The rotated pixel value is written to image data in the display buffer by setting the appropriate bits in the new memory location with the bits from the temporary byte. In another system, a table lookup scheme is used to rotate the screen contents.